import sequtils
proc pascal*(level: int): seq[seq[int]] = 
  if level == 0: return
  
  newSeq(result, level)
  result[0] = @[1]

  for i in 1..level:
    let half = (i - 1) div 2
    echo half, ",", result[i - 2][0..<half]
    if i mod 2 != 0:
      result[i-1] = if half == 0: @[1] else: concat(result[i - 2][0..<half],
        @[result[i - 2][half] * 2],
        result[i - 2][half..^1])
    else:
      result[i-1] = if half == 0: @[1, 1] else: concat(result[i - 2][0..<half],
        @[result[i - 2][half-1] + result[i - 2][half], result[i - 2][half + 1] + result[i - 2][half]],
        result[i - 2][half+1..^1])
